<template>
    <el-tree :data="data" :props="defaultProps" @node-click="handleNodeClick"></el-tree>
</template>
<script>
export default {
    created(){
        this.pagelode()
    },
    data() {
      return {
        data: [],
         defaultProps: {
          children: 'children',
          label: 'label'
        }
      };
    },
        methods: {
      handleNodeClick(data) {
        //lert(JSON.stringify(data));
        if(data.url!=null&&data.url!=""){
            this.$router.push(data.url);
        }
      },
        pagelode() {
      var _this = this;
      this.$http
        .get("/sbm/treeNode/select")
        .then(function (response) {
          console.log(response.data);
          if (response.data.code == 200) {
            _this.data = response.data.data;            
          }
        })
        .catch(function (error) {
          console.log(error);
        });
    }
    }
}
</script>
